package com.xiaolin.designmode.visitor;

/**
 * @ClassName VisitorTest
 * @Description TODO
 * @Detail detail
 * @Author MyPC
 * @Date 2020/11/8
 * @Version 1.0
 */
public class VisitorTest {
    public static void main(String[] args) {
        ObjectStructure objectStructure=new ObjectStructure();
        objectStructure.add(new ConcreteElement1());
        objectStructure.add(new ConcreteElement2());
        objectStructure.accept(new ConcreteVisitor1());
        objectStructure.accept(new ConcreteVisitor2());
    }
}
